package com.baizhi.service;

import com.baizhi.dao.UserDao;
import com.baizhi.eneity.Student;
import com.baizhi.eneity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;


    @Override
    public int login(User user) {
        User jcy=userDao.query(user.getUsername(),user.getPassword());
        if(jcy==null){ return 2;}
        if(jcy.getPassword().equals(user.getPassword())==false){ return 3;}
        else return 1;
    }
}
